import { S } from '../../s';
import { IPSAppCodeList } from '../../app/codelist/ipsapp-code-list';
import { IPSDEChartDataSetField } from './ipsdechart-data-set-field';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEChartDataSetFieldImpl
  extends PSModelObjectImpl
  implements IPSDEChartDataSetField
{
  get groupMode(): string {
    return this.M.groupMode;
  }

  get index(): number {
    return this.M.index;
  }

  protected pscodelist: IPSAppCodeList;
  getPSCodeList(): IPSAppCodeList | null {
    return (
      this.pscodelist ||
      (this.pscodelist = this.fillObjectModel(
        S._8,
        this.M.getPSCodeList,
        S._2e5,
      ) as IPSAppCodeList)
    );
  }

  get groupField(): boolean {
    return this.M.groupField;
  }
  get cls(): string {
    return 'PSDEChartDataSetFieldImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._ee || cls == S._ef) return true;
    return super.instanceof(cls);
  }
}
